import request from '@/utils/request'

// 查询任务检测点位列表
export function listPoint(query) {
  return request({
    url: '/lims/contract/point/list',
    method: 'get',
    params: query
  })
}

// 查询不分页的点位列表
export function listPoint1(query) {
  return request({
    url: '/lims/contract/point/pointList',
    method: 'get',
    params: query
  })
}

// 文字识别
export function jcxmIdentify(data) {
  return request({
    url: '/lims/contract/taskJcxm/ocr',
    method: 'post',
    data: data
  })
}

// 查询任务检测点位列表
export function listJcxmPackage(query) {
  return request({
    url: '/lims/contract/taskJcxm/packageList',
    method: 'get',
    params: query
  })
}

// 修改任务检测点位
export function updatePoint(data) {
  return request({
    url: '/lims/contract/point',
    method: 'put',
    data: data
  })
}

export function updateJcxmPj(data) {
  return request({
    url: '/lims/contract/taskJcxm/updatePj',
    method: 'put',
    data: data
  })
}


// 复制任务检测点位
export function copyTaskJcxmList(sourcePointId, targetPointId) {
  return request({
    url: '/lims/contract/taskJcxm/copy/' + sourcePointId + "/" + targetPointId,
    method: 'post'
  })
}


// 不分包与分包 => 批量删除
export function deleteSelectedJcxm(pointId, deleteArray) {
  return request({
    url: "/lims/contract/taskJcxm/delete/" + pointId + "/" + deleteArray,
    method: "delete"
  });
}

export function deleteSelectedAllJcxm(data) {
  return request({
    url: '/lims/contract/taskJcxm/delete/all',
    method: 'delete',
    data: data
  })
}

// 分包不分包弹窗的单条保存
export function saveMethodCodeList(data) {
  return request({
    url: '/lims/contract/taskJcxm',
    method: 'put',
    data: data
  })
}


export function saveJcxmCypcOrValue(data) {
  return request({
    url: '/lims/contract/taskJcxm/saveCypcOrValue',
    method: 'put',
    data: data
  })
}


// 删除任务检测点位
export function deleteSelectedJcxmByPackage(data) {
  return request({
    url: '/lims/contract/taskJcxm/delete/package',
    method: 'delete',
    data: data
  })
}

// 删除任务检测点位
export function delPoint(pointId) {
  return request({
    url: '/lims/contract/point/delete/' + pointId,
    method: 'delete'
  })
}

// 查询合同评审详细
export function listMethodJcxm(query) {
  return request({
    url: '/lims/contract/taskJcxm/jcxmList',
    method: 'get',
    params: query
  })
}

export function listJclb(primaryId) {
  return request({
    url: '/lims/contract/point/jclbList/' + primaryId,
    method: 'get',
  })
}

// 查询任务检测点位详细
export function getPoint(pointId) {
  return request({
    url: '/lims/contract/point/' + pointId,
    method: 'get'
  })
}

// 分包不分包弹窗的编辑查询当天条的方法编号
export function getMethodCodeList(mJId) {
  return request({
    url: '/lims/contract/taskJcxm/methodList/' + mJId,
    method: 'get'
  })
}

// 查询点位关联的检测项目
export function listTaskJcxm(query) {
  return request({
    url: '/lims/contract/taskJcxm/list',
    method: 'get',
    params: query
  })
}

// 根据项目方法包添加检测项目
export function addPackageTaskJcxm(data) {
  return request({
    url: '/lims/contract/taskJcxm/package',
    method: 'post',
    data: data
  })
}

export function queryJcxmGroupList(query) {
  return request({
    url: '/lims/contract/taskJcxm/jcxmGroupList',
    method: 'get',
    params: query
  })
}

export function addTaskJcxmGroupList(data) {
  return request({
    url: '/lims/contract/taskJcxm/addJcxmGroup',
    method: 'post',
    data: data
  })
}

// 不分包与分包 => 实时保存选中项
export function addSelectedJcxm(data) {
  return request({
    url: "lims/contract/taskJcxm",
    method: "POST",
    data
  })
}

// 不分包与分包 => 实时保存选中项
export function addSelectedJcxmList(data) {
  return request({
    url: "lims/contract/taskJcxm/taskJcxmList",
    method: "POST",
    data
  })
}
//复制检测点位
export function copyPoint(pointId) {
  return request({
    url: "/lims/contract/point/copy/" + pointId,
    method: "POST"
  })
}

// 查询排序号
export function getOrderId(query) {
  return request({
    url: '/lims/contract/point/getOrder',
    method: 'get',
    params: query
  })
}

// 查询分包公司列表
export function getpackage(query) {
  return request({
    url: '/lims/contract/taskJcxm/packageOrgList ',
    method: 'get',
    params: query
  })
}

export function updateIsSum(data) {
  return request({
    url: '/lims/contract/taskJcxm/updateIsSum',
    method: 'put',
    data: data
  })
}



